home *** CD-ROM | disk | FTP | other *** search
- /*
- FMP-IWPErr.js
-
- (c) Copyright 1999 FileMaker, Inc. All rights reserved.
-
- Modification History:
- 3/5/99 KJJ Created.
- */
-
- /* Err Object Definition */
-
- function display_error()
- {
- alert(this.title + this.cn + this.cr2 + this.mssg);
- if ( location.href.toLowerCase().indexOf(this.fmres) > -1 )
- {
- if ( this.where == "" )
- history.back();
- else
- {
- if ( this.where != "stop" )
- {
- this.where = this.local(this.where);
- window.location = this.where;
- }
- }
- }
- else
- history.back();
- }
-
- function insert_lang(str)
- {
- var result = "";
-
- if ( str.indexOf(this.delim) > -1 )
- {
- segments = str.split(this.delim);
- if ( segments[0] != "" )
- result = segments[0];
- result += this.getlang() + segments[1] + this.getstyle() + segments[2];
- }
- else
- result = str;
- return result;
- }
-
- function get_lang()
- {
- if ( this.lang == null )
- this.lang = this.vformat.substring(0,1);
- return this.lang;
- }
-
- function get_style()
- {
- if ( this.style == null )
- {
- this.style = this.dot;
- if ( this.vformat.indexOf(this.css) != -1 )
- this.style = this.css;
- if ( this.vformat.indexOf(this.txt) != -1 )
- this.style = this.txt;
- }
- return this.style;
- }
-
- function IWPErr()
- {
- this.display = display_error;
- this.local = insert_lang;
- this.getlang = get_lang;
- this.getstyle = get_style;
- this.english = "Z";
- this.eFormat = "-format=";
- this.where = "";
- this.delim = "~";
- this.fmres = "/fmres/";
- this.cr2 = "\r\r";
- this.cn = ":";
- this.css = "css.";
- this.txt = "txt.";
- this.dot = ".";
- this.amp = "&";
- this.title = "Unexpected Error";
- this.mssg = "Unable to process your request because the server encountered an\n" +
- "unexpected condition. For more detail on error number \"[FMP-CurrentError]\",\n" +
- "refer to the FileMaker Help topic \"Status (CurrentError)\" and\n" +
- "contact your site administrator.";
- }
- /* Create Objects */
-
- err = new IWPErr();
-